package StringTest;

/**
 * 6.2. 将邮箱@左边的3位隐藏如zhoutest@sina.com; 换成zhout***@sina.com;
 * 如12@qq.com换成1*@qq.com
 * 
 * @author AcerMr
 *
 */
public class EmailMain
{
	public static void main(String[] args)
	{
		String num = "zhoutest2222@sina.com";
		if (num.endsWith(".com"))
		{
				StringBuilder str = new StringBuilder(num);
				if (str.indexOf("@") == str.lastIndexOf("@"))
				{
					int a = str.indexOf("@");
					String str1 = str.substring(0, a);
					if (str1.length() == 2)
					{
						str.replace(1, a, "*");
						System.out.println(str);
					} else if(str1.length() == 1)
					{
						System.out.println(str);
					}else
					{
						str.replace(3, a, "*");
						System.out.println(str);
					}
				}
			}else 
			{
				System.out.println("====");
			}

	}
}
